package com.example.smartagriculture.mapper;

import com.example.smartagriculture.controller.DTO.AllEnvironmentalInformationDTO;
import com.example.smartagriculture.entity.AllEnvironmentalInformation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 张芸博
 * @since 2024-12-28
 */
@Mapper
public interface AllEnvironmentalInformationMapper extends BaseMapper<AllEnvironmentalInformation> {
    @Select("SELECT * FROM all_environmental_information ORDER BY data_update_time DESC LIMIT 10")
    ArrayList<AllEnvironmentalInformation> getLatestTenMsg();


    List<AllEnvironmentalInformationDTO> getMonthAvg();
    List<AllEnvironmentalInformationDTO> getDayAvg();
    List<AllEnvironmentalInformationDTO> getYearAvg();
}
